package jp.tuyano.helo.server;

import javax.jdo.PersistenceManager;

import jp.tuyano.core.PMF;
import jp.tuyano.helo.client.AddPDService;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;

public class AddPDServiceImpl extends RemoteServiceServlet implements
        AddPDService {

    private static final long serialVersionUID = 1L;

    public String addEntities(String name, String mail, String tel,
            String memo) {

        PersonalData data = new PersonalData(name, mail, tel, memo);
        PersistenceManager pm = PMF.get().getPersistenceManager();
        try {
            pm.makePersistent(data);
        } catch (RuntimeException e) {
            e.printStackTrace();
        } finally {
            pm.close();
        }
        return "OK!! create data!!";
    }

}
